package com.example.neteasecloudmusic.ui.base;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.IdRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public abstract class BaseFragment extends Fragment {

    private View contentVIew;

    protected abstract void initViews ();

    protected abstract int getLayoutId ();

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        contentVIew = inflater.inflate(getLayoutId(), container, false);
        initViews();
        return contentVIew;
    }

    protected <T extends View> T find (@IdRes int id) {
        return contentVIew.findViewById(id);
    }



}
